package tw.asap.plus.presenter;


public class BindClientPresenterImpl implements BindClinetPresenter, OnFinishedListener{

    private BaseView baseView;
    public BindClientPresenterImpl(BaseView baseView){
        this.baseView = baseView;
    }
    @Override
    public void onSuccess() {
        baseView.onSuccess();
    }

    @Override
    public void onFailed(String resperr) {
        baseView.onFailed(resperr);
    }

    @Override
    public void bindClinet(String clientId) {
        bindClientId(clientId);
    }


    private void bindClientId( String clientId) {
//        Map<String, Object> params = new HashMap<>();
//        params.put("appver", Utils.getAppVersion(baseView.getContext()));
//        params.put("app_type", 402);
//        params.put("deviceid", Utils.getDeviceId(baseView.getContext()));
//        params.put("clientid", clientId);
//        NormalStringRequest request = new NormalStringRequest(baseView.getContext(), Request.Method.POST, params,
//                ConstValue.BIND_CLIENT_URL, profileListener, profileListener);
//        VolleyController.getInstance().addToRequestQueue(request);
    }


//    NormalStringResponseListener profileListener = new NormalStringResponseListener() {
//        @Override
//        public void onResponse(String response) {
//            super.onResponse(response);
//            JSONObject object;
//            try {
//                object = new JSONObject(response);
//                if (object.getString("respcd").equals(ConstValue.RESPCD)) {
//                    //获取商户信息
//                    onSuccess();
//                } else {
//                    String resperr = object.getString("resperr");
//                    onFailed(resperr);
//                }
//
//            } catch (JSONException e) {
//                e.printStackTrace();
//                onFailed("");
//            }
//        }
//
//        @Override
//        public void onErrorResponse(VolleyError error) {
//            super.onErrorResponse(error);
//            onFailed("");
//        }
//    };

}
